package com.explorer.ider.bootguide.itembean;

import java.text.Collator;
import java.util.Locale;

/**
 * Created by Eric on 2016/9/8.
 */
public class LocaleInfo implements Comparable<LocaleInfo> {
    static final Collator sCollator = Collator.getInstance();

    public String label;
    public Locale locale;

    public LocaleInfo(String label, Locale locale) {
        this.label = label;
        this.locale = locale;
    }

    public String getLabel() {
        return label;
    }

    public Locale getLocale() {
        return locale;
    }

    @Override
    public String toString() {
        return this.label;
    }

    @Override
    public int compareTo(LocaleInfo another) {
        return sCollator.compare(this.label, another.label);
    }
}
